#include <stdio.h>
#include "ofc/DSHA1.h"

int main(int argc, char *argv[])
{
  DSHA1 *sha1  = [DSHA1 alloc];
  DSHA1 *sha2  = [DSHA1 new  ];
  DText *str;
  int    i;

  [sha1 init :"Test string for the SHA1 class"]; // Init with c-string

  str = [sha1 hexdigest];              // Convert to string and print
  printf("SHA1 for the test string:%s.\n", [str cstring]);
  [str free];

  for (i = 0; i < 10; i++)
  {
    [sha2 update :"abcdefghijklmnopqrstuvwxyz"]; // Repeated adding strings to sha
  }
  str = [sha2 hexdigest];              // Convert to string and print
  printf("SHA1 for the repeated test string:%s.\n", [str cstring]);
  [str free];

  [sha1 free];                         // Cleanup
  [sha2 free];

  return 0;
}
